package com.clhbolg.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clhbolg.domain.Comment;
import com.clhbolg.domain.vo.CommentVo;
import com.clhbolg.model.dto.CommentAdminDTO;
import com.clhbolg.model.dto.CommentCountDTO;
import com.clhbolg.model.dto.CommentDTO;
import com.clhbolg.model.dto.ReplyDTO;
import com.clhbolg.model.vo.request.CommentVO;
import com.clhbolg.model.vo.request.ConditionVO;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;
import org.apache.poi.ss.formula.functions.T;

import java.util.List;

/**
 * 【请填写功能名称】Mapper接口
 *
 * @author cailinhu
 * @date 2023-02-08
 */
@DS("slave")
public interface CommentMapper extends BaseMapperPlus<CommentMapper, Comment, CommentVo> {

    List<CommentDTO> listTopSixComments();

    Page<CommentDTO> listRootComments(@Param("vo") CommentVO vo, Page<T> page);

    List<ReplyDTO> listReplies(@Param("commentIds") List<Long> commentIds);

    List<CommentCountDTO> listCommentCountByTypeAndTopicIds(@Param("type") Integer type, @Param("topicIds") List<Integer> topicIds);

    Page<CommentAdminDTO> listCommentsAdmin(@Param("vo")  ConditionVO conditionVO, Page<T> page);
}
